#!/bin/bash
# download 
wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz
# install
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz
# set env; .bashrc or .zshrc
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc

# update proxy
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

# echo version
go version